﻿using System;
using System.Linq;

namespace _3.Lexicograf
{
    class Lexicograf
    {
        static void Main(string[] args)
        {
            char[] array1 = { 'a', 'l', 'b' };
            char[] array2 = { 'a', 'k', 'c' };
            int arr1Length = array1.Length;
            int arr2Length = array2.Length;
            char[] bestArr = array1;
            if (arr1Length != arr2Length)
            {
                if (arr1Length > arr2Length)
                {
                    Console.WriteLine("The second array is best");
                }
                else
                {
                    Console.WriteLine("The first array is best");
                }
            }
            if (arr1Length == arr2Length)
            {
                for (int i = 0; i <= array1.Length - 1; i++)
                {
                    for (int j = 0; j <= array2.Length - 1; j++)
                    {
                        if (array1[i] < array2[j])
                        {
                            bestArr = array1;
                        }
                        else
                        {
                            bestArr = array2;

                        }

                    }

                }

            }
            Console.Write("The best arr is: ");
            Console.WriteLine(bestArr);

        }
    }
}

